/*
 * byte_stream.h
 *
 *  Created on: 2008-12-10
 *      Author: ant
 */

#ifndef TEST_BYTE_STREAM_H_
#define TEST_BYTE_STREAM_H_

#include "toxic.h"

using namespace toxic;

void do_test_byte_stream() {

	cout << "***** byte_stream *****" << endl;

	ByteStream bs(LITTLE_ENDIAN_);
	bs << uint16_t(0x0102);
	bs << false;
	bs << "hello";
	bs << uint32_t(0x0A0B0C0D);
	bs << uint64_t(0x0102030405060708ULL);
	bs << 1234.56789f;

	uint16_t a = 0;
	bool b = true;
	string s;
	uint32_t d = 0;
	uint64_t e = 0;
	float ff = 0.0;

	bs >> a >> b >> s >> d >> e >> ff;

	uint16_t ii = 123;
	bs >> ii;

	bs << ff;

	float fff = 0.0;
	bs >> fff;
	bs.dump("E:/byte.bin");
}

#endif /* TEST_BYTE_STREAM_H_ */
